<template>
  <view class="page" v-if="pageData">
    <view v-if="pageData.type == 1" class="list">
      <template v-for="item in pageData.list">
        <auditMessageItem :data="item" />
      </template>
    </view>

    <view v-else-if="pageData.type == 2" class="list">
      <view v-for="item in pageData.list">
        <verifyMessageItem :data="item" />
      </view>
    </view>
  </view>
</template>

<script setup>
  import { ref } from 'vue';
  import { onShow, onLoad } from '@dcloudio/uni-app';
  import auditMessageItem from '@/components/auditMessageItem/auditMessageItem.vue';
  import verifyMessageItem from '@/components/verifyMessageItem/verifyMessageItem.vue';
  import { useUserStore } from '../../store/user';

  const userStore = useUserStore();
  const msgType = ref('');

  const pageData = ref();
  onLoad(() => {
    pageData.value = userStore.messageData;
    console.log('pageData', pageData.value);
  });
</script>

<style scoped lang="scss">
  .page {
    width: 100vw;
    min-height: 100vh;
    padding: 20rpx;
    box-sizing: border-box;
    font-size: 28rpx;
    background-color: #f5f5f5;
  }

  .content {
    background-color: #fff;
    padding: 20rpx;
    border-radius: 16rpx;
    box-sizing: border-box;
    margin-bottom: 30rpx;
  }

  .list {
  }
</style>
